import { createSlice } from '@reduxjs/toolkit';
import { initStates, State } from './initState';
import * as reducers from './reducer';

const themeStore = createSlice({
  name: 'theme',
  initialState: initStates,
  reducers,
});

export const {
  setDarkMode,
  setPageCompack,
  setLayoutMode,
  setThemeConfig,
  setMenuConfig,
  changeCollapsed,
  setHeaderConfig,
  resetTheme,
} = themeStore.actions;
export type ThemeState = State;

export default themeStore.reducer;
